package com.zjmzxfzhl.modules.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.common.base.BaseService;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseOrderDetailDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.PurchaseMaterialDetailVo;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseMaterial;

import java.util.List;

/**
 * Service
 *
 * @author 庄金明
 */
public interface PurchaseMaterialService extends BaseService<PurchaseMaterial> {
    /**
     * 分页查询
     *
     * @param page
     * @param purchaseMaterial
     * @return
     */
    IPage<PurchaseMaterial> list(IPage<PurchaseMaterial> page, PurchaseMaterial purchaseMaterial);

    /**
     * 查询数据库物料信息，如果没有则新增
     * @param material
     * @return
     */
    PurchaseMaterial validPurchaseMaterial(PurchaseMaterial material);

    /**
     * 删除物料（设备）
     * @param ids
     */
    void deleteByIds(List<Long> ids);

    /**
     * 比对物料信息（更新物料或者插入新版本）
     * @param dbMaterialList
     * @param material
     * @return
     */
    PurchaseMaterial findOrInsert(List<PurchaseMaterial> dbMaterialList, PurchaseMaterial material);

}
